Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create synchronized store for user information #1010

Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Nov 26, 2020

Goal

Creates a synchronized store which is used for reading & writing user information. This replaces SharedPreferences which is not safe for use in a multi process environment, and does not give control over the location where information is persisted.

Changeset

  • Created SynchronizedStreamableStore, which is capable of reading and writing Streamable objects
  • Synchronized access to the persist() and load() methods with a ReentrantReadWriteLock so that concurrent reads of the information is possible when the file is not being written
  • Added method to allow deserialization of User, along with JsonReadable interface

Testing

Created instrumentation tests which verify that data can be persisted and loaded, and that the read lock allows concurrent access.

@fractalwrench fractalwrench changed the title Create synchronized streamable store Create synchronized store for user information Nov 26, 2020
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Nov 26, 2020

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1442.35 1361.31
arm64_v8a 369.25 287.32
armeabi 348.76 266.85
armeabi_v7a 332.39 250.47
x86 410.2 328.27
x86_64 393.81 307.81

Generated by 🚫 Danger

@fractalwrench fractalwrench marked this pull request as ready for review November 26, 2020 13:37
@fractalwrench fractalwrench merged commit 0d3c8b9 into integration/road-958-multi-process Nov 27, 2020
@fractalwrench fractalwrench deleted the PLAT-5401/synchronized-store branch November 27, 2020 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants